<?php
defined('_JEXEC') or die('Restricted access');



?>

<div class="container galeria-imagens">
<h3>Galeria de Imagens</h3>

<?php 



echo '<h4 class="title">';
echo $this->escape($this->category->title);		
echo '</h4>';
?>
<?php  if (!empty($this->items)) {?>
	<ul>
		<?php 
			$i=0;
			foreach($this->items as $ck => $cv) 
			{
				$ano = substr($cv->date, 0, 4);
				$mes = substr($cv->date, 5, 2);
				$dia = substr($cv->date, 8, 2);
								
				$imageThumb = $cv->linkthumbnailpath;
				$title = $cv-> title;
				$linkorig = $cv->linkorig;
				
				$item_type = $cv->item_type;
						
				?>
					<li <?php if ($i % 4 == 3 ) echo "class='itemrg'";?>  >
						
						<?php if($title != 'Lista de Categorias'):?>
						<?php if($dia!=''):?>
							<span class="date"><?php echo $dia . "/".$mes."/".$ano ?></span>
						<?php endif;?>
						<span class="title"><?php echo $title ?></span>
							<?php endif;?>
						
						<?php if($item_type  !='image'):?>
						<a href="javascript:history.back()">
							<img alt="" src="<?php echo $imageThumb;?>">
						</a>
						<?php else:?>
						<a 
							<?php if($title != 'Lista de Categorias'):?>
							class="fancybox-thumb" rel="fancybox-thumb"
							href="<?php echo $linkorig?>" 
							<?php endif;?>
							
						 title="<?php echo $title ?>">
						<img alt="" src="<?php echo $imageThumb;?>">
						</a>
						<?php endif;?>
					</li>
				<?php 
				$i++;
			}
			

		?>
	</ul>
<?php } ?>



</div>

